package com.example.ragproject.service.Impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.example.ragproject.bean.Appointment;
import com.example.ragproject.mapper.AppiontmentMapper;
import com.example.ragproject.service.AppiontmentService;
import org.springframework.stereotype.Service;


@Service
public class AppiontmentServiceImpl extends ServiceImpl<AppiontmentMapper, Appointment> implements AppiontmentService {



    @Override
    public Appointment getOne(Appointment appointment) {
        LambdaQueryWrapper<Appointment> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(Appointment::getUsername,appointment.getUsername());
        queryWrapper.eq(Appointment::getIdCard,appointment.getIdCard());
        queryWrapper.eq(Appointment::getDepartment,appointment.getDepartment());
        queryWrapper.eq(Appointment::getTime,appointment.getTime());
        queryWrapper.eq(Appointment::getDate,appointment.getDate());
        queryWrapper.eq(Appointment::getDoctorName,appointment.getDoctorName());
        Appointment appointmentDB = baseMapper.selectOne(queryWrapper);
        return appointmentDB;
    }
}
